<?php

class Application_Model_Kosarica
{
    protected $_active;
    protected $_sifra_kosarice;
    protected $_stranka_emso;
    protected $_total;


    public function __construct(array $options = null)
    {
        if (is_array($options)) {
            $this->setOptions($options);
        }
    }

    public function __set($name, $value)
    {
        $method = 'set' . $name;
        if (('mapper' == $name) || !method_exists($this, $method)) {
            throw new Exception('Invalid product property');
        }
        $this->$method($value);
    }

    public function __get($name)
    {
        $method = 'get' . $name;
        if (('mapper' == $name) || !method_exists($this, $method)) {
            throw new Exception('Invalid product property');
        }
        return $this->$method();
    }

    public function setOptions(array $options)
    {
        $methods = get_class_methods($this);
        foreach ($options as $key => $value) {
            $method = 'set' . ucfirst($key);
            if (in_array($method, $methods)) {
                $this->$method($value);
            }
        }
        return $this;
    }
    
    
    public function setSifra_kosarice($kosarica)
    {
        $this->_sifra_kosarice = $kosarica;
        return $this;
    }

    public function getSifra_kosarice()
    {
        return $this->_sifra_kosarice;
    }

    public function setActive($text)
    {
        $this->_active = (string) $text;
        return $this;
    }

    public function getActive()
    {
        return $this->_active;
    }

    public function setStranka_emso($stranka_emso)
    {
        $this->_stranka_emso = $stranka_emso;
        return $this;
    }


    public function getStranka_emso()
    {
        return $this->_stranka_emso;
    }

    
    public function setTotal($total)
    {
        $this->_total = $total;
        return $this;
    }

    public function getTotal()
    {
        return $this->_total;
    }
}

